#/***************************************************************************\
# * Copyright (C) by Keio University
# * CMakeLists.txt created in 09 2011.
# * Mail : fdesorbi@hvrl.ics.keio.ac.jp
# *
# * This file is part of the HVRL Engine Library.
# *
# * The HVRL Engine Library is free software; you can redistribute it and/or modify
# * it under the terms of the GNU Lesser General Public License as published by
# * the Free Software Foundation; either version 3 of the License, or
# * (at your option) any later version.
# *
# * The HVRL Engine Library is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# * GNU Lesser General Public License for more details.
# *
# * You should have received a copy of the GNU Lesser General Public License
# * along with this program.  If not, see <http://www.gnu.org/licenses/>.
# *
# ***************************************************************************/


SET(HVRL_BUILD_OPENGL ON CACHE BOOL "Build opengl module")
SET(HVRL_BUILD_VIDEO ON CACHE BOOL "Build video module")
SET(HVRL_BUILD_TOOLS ON CACHE BOOL "Build tools module")
SET(HVRL_BUILD_COMPUTER_VISION ON CACHE BOOL "Build computer-vision module")
SET(HVRL_BUILD_DISPLAY ON CACHE BOOL "Build display module")
SET(HVRL_BUILD_SENSOR ON CACHE BOOL "Build sensor module")
SET(HVRL_BUILD_GPGPU ON CACHE BOOL "Build gpgpu module")

ADD_SUBDIRECTORY(common)

ADD_SUBDIRECTORY(datatypes)

IF(CUDA_FOUND AND CUTIL_FOUND AND HVRL_BUILD_GPGPU AND WITH_CUDA_AVAILABLE)
ADD_SUBDIRECTORY(gpgpu)
ENDIF()

IF(HVRL_BUILD_OPENGL AND OPENGL_FOUND AND GLM_FOUND)
	ADD_SUBDIRECTORY(opengl)
ELSE()
	MESSAGE(FATAL_ERROR "Cannot build opengl module - Missing dependencies")
ENDIF()

#IF(HVRL_BUILD_VIDEO AND OpenCV_FOUND)
#	ADD_SUBDIRECTORY(video)
#ELSE()
#	MESSAGE(FATAL_ERROR "Cannot build video module - Missing dependencies")
#ENDIF()

IF(HVRL_BUILD_TOOLS AND OPENGL_FOUND AND GLM_FOUND AND OpenCV_FOUND)
	ADD_SUBDIRECTORY(tools)
ELSE()
	MESSAGE(FATAL_ERROR "Cannot build tools module - Missing dependencies")
ENDIF()

IF(HVRL_BUILD_COMPUTER_VISION AND OpenCV_FOUND)
	ADD_SUBDIRECTORY(computer-vision)
ELSE()
	MESSAGE(FATAL_ERROR "Cannot build computer-vision module - Missing dependencies")
ENDIF()

IF(HVRL_BUILD_DISPLAY AND OpenCV_FOUND)
	ADD_SUBDIRECTORY(display)
ELSE()
	MESSAGE(FATAL_ERROR "Cannot build display module - Missing dependencies")
ENDIF()

IF(HVRL_BUILD_SENSOR AND OPENGL_FOUND)
ADD_SUBDIRECTORY(sensor)
ENDIF()


